﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using DataContracts;

namespace OrgPropertyWCFService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class PropertyDataCollectorService : IPropertyDataCollectorService
    {
        public string PostChanges(List<PropertyItem> items)
        {
            //DataTable table
            //var connector = new RegisterDataBaseConnector();
            //DataTable tableforSending = connector.RegisterTable;
            //return tableforSending;

            var idents = items.Select(item => item.Ident);

            return "Данные успешно переданы: \n " + String.Join(", ", idents.ToArray());
        }

        //[DataContract]
        //public class PropertyItem
        //{
        //    [DataMember]
        //    public string Ident;
        //    [DataMember]
        //    public int Price; 
        //}
    }
}
